package shoooter.entity;

import shoooter.geometry.Vec2;


public class BasicGameEntity {

    /* Vectors for the Entity */
    public Vec2 vPos;
    public Vec2 vSpe;
    protected Vec2 vAcc;

    /* Contains true if the entity is alive */
    private boolean alive;

    public BasicGameEntity() {
        this.setvPos(Vec2.nullVec2());
        this.setvSpe(Vec2.nullVec2());
        this.setvAcc(Vec2.nullVec2());
        this.setAlive(true);
    }


    /* Getters & Setters */
    public Vec2 getvAcc() { return vAcc; }
    public final void setvAcc(Vec2 vAcc) { this.vAcc = vAcc; }

    public Vec2 getvPos() { return vPos; }
    public final void setvPos(Vec2 vPos) { this.vPos = vPos; }

    public Vec2 getvSpe() { return vSpe; }
    public final void setvSpe(Vec2 vSpe) { this.vSpe = vSpe; }

    public boolean isAlive() { return alive; }
    public final void setAlive(boolean b) { this.alive = b; }

    public double getX() { return vPos.getX(); }
    public double getY() { return vPos.getY(); }
    public double getZ() { return vPos.getZ(); }

    public void setX(double x) { vPos.setX(x); }
    public void setY(double y) { vPos.setY(y); }
    public void setZ(double z) { vPos.setZ(z); }

    public void move() {
        vPos.setX(vPos.getX() + vSpe.getX());
        vPos.setY(vPos.getY() + vSpe.getY());
    }
}
